package com.kizuki.stream;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class User implements Comparable<User>{
    private int lv;
    private String name;

    public User(int lv) {
        this.lv = lv;
    }

    public User(int lv, String name) {
        this.lv = lv;
        this.name = name;
    }

    @Override
    public String toString() {
        StringBuilder s = new StringBuilder(10);
        s.append("User{\"lv=\"");
        s.append(lv);
        s.append('}');
        return  s.toString();
    }

    @Override
    public int compareTo(User o) {
        return Integer.compare(o.lv, this.lv);
    }

    static class Phone{
        final String name;
        final int number;

        public Phone(String name, int number) {
            this.name = name;
            this.number = number;
        }
    }

}
